import request from "../utils/request";
import qs from "qs"

export function getListApi(pages) {
  return request({
    url: "/exam/getQuestions",
    method: "get",
    params: {
      ...pages
    },
    baseURL: "http://localhost:2345"
  });
}

export function deleteListApi(ids) {
  return request({
    url: "/exam/questionsDel",
    method: "get",
    params: {
      id: ids
    },
    baseURL: "http://localhost:2345"
  });
}

export function addOrUpdateApi(data) {
  return request({
    url: `exam/${data.id ? "questionsUpdate" : "questionsInsert"}`,
    method: "post",
    data: qs.stringify(data),
    baseURL: "http://localhost:2345"
  });
}
